from datetime import datetime as dt


def date2str(date):
    return date.strftime('%Y%m%d')

def str2date(s):
    return dt.strptime(s, '%Y%m%d')
